package com.wmh.baseservice.common.utils.page.pojo;

import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;

/**
 * @author
 */
public class PageSortRoles extends LinkedHashMap<String, LinkedHashMap<String, String>> {

    public PageSortRoles(int initialCapacity, float loadFactor) {
        super(initialCapacity, loadFactor);
    }

    public PageSortRoles(int initialCapacity) {
        super(initialCapacity);
    }

    public PageSortRoles() {
        super();
    }

    public PageSortRoles(LinkedHashMap<? extends String, ? extends LinkedHashMap<String, String>> m) {
        super(m);
    }

    /**
     * 添加排序规则
     * @param sortKey key
     * @param sortField 排序字段
     * @param sortWay 排序方式 (desc, asc)
     */
    public void putPageSortRoles(String sortKey, String sortField, SortWay sortWay){
        LinkedHashMap<String, String> sortMap = new LinkedHashMap<>();
        sortMap.put("field", sortField);
        sortMap.put("way", sortWay.toString());
        this.put(sortKey, sortMap);
    }

}

